﻿<!-- 请假流程图 -->
<div class="panel">
	<div class="panel-head">
		<h4>流程图</h4>
	</div>
	<div class="panel-body">
		<img alt="流程图" th:src="@{${'/department/leave/me/diagram/' + leaveData.id}}">
	</div>
</div>
<!-- 请假基本信息 -->
<div class="panel">
	<div class="panel-head">
		<h4>请假信息</h4>
	</div>
	<div class="panel-body">
		<table>
			<tr>
				<td>请假人</td>
				<td th:text="${leaveData.applyName}"></td>
				<td>请假类型</td>
				<td th:text="${leaveData.applyType}"></td>
			</tr>
			<tr>
				<td>请假原因</td>
				<td th:text="${leaveData.applyReason}"></td>
				<td>请假时长</td>
				<td th:text="${leaveData.applyHours}"></td>
			</tr>
			<tr>
				<td>状态</td>
				<td th:text="${leaveData.status}"></td>
			</tr>
		</table>
	</div>
</div>
<!-- 当前任务需要提交的表单 -->
<div class="panel" th:if="${leaveData.isCandidate()}">
	<div class="panel-head">
		<h4 th:text="${leaveData.status}"></h4>
	</div>
	<div class="panel-body">
		<form id="formDepartmentQfLeaveMeManager" method="post"
			class="form-x form-tips radius-big"
			th:if="${leaveData.status == 'taskManager'}">
			<input type="hidden" class="input" name="id" th:value="${leaveData.id}" />
			<div class="form-group">
				<div class="label">
					<label for="managerResult">部门审批结果</label>
				</div>
				<div class="field">
					<div class="button-group radio">
						<label class="button"> <input name="managerResult" value="true"
							type="radio" data-validate="required:必填,radio:请选择">同意
						</label>
						<label class="button"> <input name="managerResult" value="false"
							type="radio" data-validate="required:必填,radio:请选择">不同意
						</label> 
					</div>
				</div>
			</div>
			<div class="form-group">
				<div class="label">
					<label>部门审批说明</label>
				</div>
				<div class="field">
					<input type="text" class="input" name="managerRemark"
						placeholder="请输入部门审批说明" />
				</div>
			</div>
		</form>
		<form id="formDepartmentQfLeaveMeHR" method="post"
			class="form-x form-tips radius-big"
			th:if="${leaveData.status == 'taskHR'}">
			<input type="hidden" class="input" name="id" th:value="${leaveData.id}" />
			<div class="form-group">
				<div class="label">
					<label for="hrResult">人事审批结果</label>
				</div>
				<div class="field">
					<div class="button-group radio">
						<label class="button"> <input name="hrResult" value="true"
							type="radio" data-validate="required:必填,radio:请选择">是
						</label>
						<label class="button"> <input name="hrResult" value="false"
							type="radio" data-validate="required:必填,radio:请选择">否
						</label> 
					</div>
				</div>
			</div>
			<div class="form-group">
				<div class="label">
					<label>人事确认说明</label>
				</div>
				<div class="field">
					<input type="text" class="input" name="hrRemark"
						placeholder="请输入人事确认说明" />
				</div>
			</div>
		</form>
		<form id="formDepartmentQfLeaveMeCEO" method="post"
			class="form-x form-tips radius-big"
			th:if="${leaveData.status == 'taskCEO'}">
			<input type="hidden" class="input" name="id" th:value="${leaveData.id}" />
			<div class="form-group">
				<div class="label">
					<label for="ceoResult">CEO审批结果</label>
				</div>
				<div class="field">
					<div class="button-group radio">
						<label class="button"> <input name="ceoResult" value="true"
							type="radio" data-validate="required:必填,radio:请选择">同意
						</label>
						<label class="button"> <input name="ceoResult" value="false"
							type="radio" data-validate="required:必填,radio:请选择">不同意
						</label> 
					</div>
				</div>
			</div>
			<div class="form-group">
				<div class="label">
					<label>CEO审批说明</label>
				</div>
				<div class="field">
					<input type="text" class="input" name="ceoRemark"
						placeholder="请输入CEO审批说明" />
				</div>
			</div>
		</form>
		<hr class="bg-gray" />
		<div class="form-button">
			<button type="button" class="button bg-main"
				id="btnDepartmentQfLeaveMeProcessFormSubmit">提交</button>
			<button type="button" class="button bg-yellow"
				id="btnDepartmentQfLeaveMeProcessFormCancel">取消</button>
		</div>
	</div>
</div>
<!-- 请假流程日志 -->
<div class="panel">
	<div class="panel-head">
		<h4>流程日志</h4>
	</div>
	<div class="panel-body">
		<table>
			<tr>
				<th>当前任务</th>
				<th>执行时间</th>
				<th>执行人</th>
				<th>审批结果</th>
				<th>执行说明</th>
			</tr>
			<tr th:each="log : ${leaveData.logs}">
				<td th:text="${log.taskName}"></td>
				<td th:text="${log.endTime}"></td>
				<th:block th:if="${log.taskKey == 'taskApply'}">
					<td th:text="${log.formData.get('applyName')}"></td>
					<td>无</td>
					<td th:text="${log.formData.get('applyReason')}"></td>				
				</th:block>
				<th:block th:if="${log.taskKey == 'taskManager'}">
					<td th:text="${log.formData.get('managerName')}"></td>
					<td th:text="${log.formData.get('managerResult')}"></td>
					<td th:text="${log.formData.get('managerRemark')}"></td>				
				</th:block>
				<th:block th:if="${log.taskKey == 'taskHR'}">
					<td th:text="${log.formData.get('hrName')}"></td>
					<td th:text="${log.formData.get('hrResult')}"></td>
					<td th:text="${log.formData.get('hrRemark')}"></td>			
				</th:block>
				<th:block th:if="${log.taskKey == 'taskCEO'}">
					<td th:text="${log.formData.get('ceoName')}"></td>
					<td th:text="${log.formData.get('ceoResult')}"></td>
					<td th:text="${log.formData.get('ceoRemark')}"></td>			
				</th:block>
			</tr>
		</table>
	</div>
</div>